package com.quxiang.pay.model;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

@SuppressWarnings("serial")
@JsonInclude(Include.NON_NULL)
public class ResponseModel<T> implements Serializable {

	private int result;
	private String resultMsg;
	private T data;
	private List<T> datas;

	public ResponseModel() {

	}
	

	public ResponseModel(T data) {

		this.result = 0;
		this.resultMsg = "成功";
		this.data = data;
	}

	public ResponseModel(List<T> datas) {

		this.result = 0;
		this.resultMsg = "成功";
		this.datas = datas;

	}

	public ResponseModel(int code, String msg) {

		this.result = code;
		this.resultMsg = msg;

	}

	public void setInfo(int result,String msg){
		this.result = result;
		this.resultMsg  = msg;
	}
	

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public List<T> getDatas() {
		return datas;
	}

	public void setDatas(List<T> datas) {
		this.datas = datas;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

}
